<template>
  <div>
    <el-row :gutter="20">
      <div class="wapperSon">
        <el-autocomplete
          class="inline-input"
          style="max-width:120px;font-size:12px;"
          v-model="queryConditions.orderNo"
          :fetch-suggestions="querySearch"
          placeholder="订单编号"
          @select="handleSelect"
          @input="handleInput"
        ></el-autocomplete>
        <el-input
          v-model="queryConditions.productNo"
          placeholder="产品编号"
          style="max-width:120px;font-size:12px;"
        ></el-input>
        <el-input
          v-model="queryConditions.procedureNo"
          placeholder="生产工序号"
          style="max-width:120px;font-size:12px;"
        ></el-input>
        <span>交期: </span>
        <el-date-picker
          style="max-width:240px;font-size:12px;"
          v-model="selectedDatetimeRange"
          type="datetimerange"
          range-separator="至"
          start-placeholder="开始日期"
          end-placeholder="结束日期"
          @change="handleDateSelectChange"
        >
        </el-date-picker>
        <span>日计划排产周期: </span>
        <el-date-picker
          style="max-width:240px;font-size:13px;"
          v-model="queryConditions.scheduleDate"
          type="datetime"
          placeholder="选择日期时间"
          @change="handleDateSelectChange"
        >
        </el-date-picker>
      </div>
    </el-row>
    <el-row :gutter="20">
      <div class="wapperSon">
        <el-button-group style="float: left">
          <el-button
            type="primary"
            icon="el-icon-search"
            class="el-button--medium"
            @click="fetchData"
            >查询</el-button
          >
          <el-button type="primary" style="float: " icon="el-icon-refresh-left" @click="goDayReport()">
            重置
          </el-button>
          <el-button type="primary" style="float: " icon="el-icon-document" @click="goDayReport()">
            详情
          </el-button>
          <el-button type="primary" style="float:  " icon="el-icon-edit" @click="handleUpdate()">
            编辑
          </el-button>
          <el-button type="danger" style="float: " icon="el-icon-delete" @click="deletePlan">
            删除
          </el-button>
          <el-button type="primary" style="float: " icon="el-icon-document-add" @click="addOrder()">
            添加订单
          </el-button>
          <el-button type="primary" style="float: "   icon="el-icon-date" @click="sechedule()">
            排产
          </el-button>
          <el-button type="primary" style="float: "  icon="el-icon-c-scale-to-original"  @click="secheduleReverse()">
            倒序排产
          </el-button>
          <el-button type="primary" style="float: " icon="el-icon-tickets" @click="goDayReport()">
            物料需求表
          </el-button>
        </el-button-group>
      </div>
    </el-row>
    <el-row :gutter="20">
      <el-card class="box-card" shadow="never">
        <div slot="header" class="clearfix">
          <span>订单列表</span>
        </div>
        <el-row type="flex" justify="start">
          <el-table
            v-loading="listLoading"
            :data="list"
            element-loading-text="Loading"
            border
            fit
            highlight-current-row
            @row-click="rowClick"
            @selection-change="handleSelectionChange"
          >
            <el-table-column type="selection" width="55"></el-table-column>
            <el-table-column
              align="center"
              label="订单编号"
              width="95"
              style="display:none;"
            >
              <template slot-scope="scope">
                {{ scope.row.orderNo }}
              </template>
            </el-table-column>
            <el-table-column
              align="center"
              label="产品编号"
              width="95"
              style="display:none;"
            >
              <template slot-scope="scope">
                {{ scope.row.productNo }}
              </template>
            </el-table-column>
            <el-table-column
              align="center"
              label="产品名称"
              width="95"
              style="display:none;"
            >
              <template slot-scope="scope">
                {{ scope.row.productName }}
              </template>
            </el-table-column>
            <el-table-column
              align="center"
              label="产线编号"
              width="95"
              style="display:none;"
            >
              <template slot-scope="scope">
                {{ scope.row.produceLineNo }}
              </template>
            </el-table-column>
            <el-table-column
              align="center"
              label="产线名称"
              width="95"
              style="display:none;"
            >
              <template slot-scope="scope">
                {{ scope.row.produceLineName }}
              </template>
            </el-table-column>
            <el-table-column
              align="center"
              label="批次"
              width="95"
              style="display:none;"
            >
              <template slot-scope="scope">
                {{ scope.row.batch }}
              </template>
            </el-table-column>
            <el-table-column
              align="center"
              label="客户需求量"
              width="95"
              style="display:none;"
            >
              <template slot-scope="scope">
                {{ scope.row.totalAmount }}
              </template>
            </el-table-column>
            <el-table-column
              align="center"
              label="已生产数量"
              width="95"
              style="display:none;"
            >
              <template slot-scope="scope">
                {{ scope.row.producedAmount }}
              </template>
            </el-table-column>
            <el-table-column
              align="center"
              label="未生产数量"
              width="95"
              style="display:none;"
            >
              <template slot-scope="scope">
                {{ scope.row.planAmount }}
              </template>
            </el-table-column>
            <el-table-column
              align="center"
              label="交货时间"
              width="95"
              style="display:none;"
            >
              <template slot-scope="scope">
                {{ scope.row.deliveryDate }}
              </template>
            </el-table-column>
            <el-table-column
              align="center"
              label="计划开始时间"
              width="95"
              style="display:none;"
            >
              <template slot-scope="scope">
                {{ scope.row.planProduceStartDate }}
              </template>
            </el-table-column>
            <el-table-column
              align="center"
              label="计划结束时间"
              width="95"
              style="display:none;"
            >
              <template slot-scope="scope">
                {{ scope.row.planProduceEndDate }}
              </template>
            </el-table-column>
            <el-table-column
              align="center"
              label="工期"
              width="95"
              style="display:none;"
            >
              <template slot-scope="scope">
                {{ scope.row.duration }}
              </template>
            </el-table-column>
            <el-table-column
              align="center"
              label="最晚生产开始时间"
              width="95"
              style="display:none;"
            >
              <template slot-scope="scope">
                {{ scope.row.latestProduceStartDate }}
              </template>
            </el-table-column>
            <el-table-column
              align="center"
              label="最晚生产结束时间"
              width="95"
              style="display:none;"
            >
              <template slot-scope="scope">
                {{ scope.row.latestProduceEndDate }}
              </template>
            </el-table-column>
            <el-table-column
              align="center"
              label="排产状态"
              width="95"
              style="display:none;"
            >
              <template slot-scope="scope">
                {{ scope.row.scheduleState | statusFilter }}
              </template>
            </el-table-column>
            <el-table-column
              align="center"
              label="自由时差"
              width="95"
              style="display:none;"
            >
              <template slot-scope="scope">
                {{ scope.row.freeFloat }}
              </template>
            </el-table-column>
            <el-table-column
              align="center"
              label="优先级"
              width="95"
              style="display:none;"
            >
              <template slot-scope="scope">
                {{ scope.row.priority }}
              </template>
            </el-table-column>
          </el-table>
        </el-row>
        <el-row>
          <pagination
            v-show="total > 0"
            :total="total"
            :page.sync="listQuery.page"
            :limit.sync="listQuery.limit"
            :page-sizes="listQuery.pageSizes"
            @pagination="fetchData"
          />
        </el-row>
      </el-card>
    </el-row>
    <orderselectdlg
      :dialogVisible="this.dialogFormVisible"
      @hideDlg="hideDlg"
      @refreshTbl="this.fetchData"
    ></orderselectdlg>
    <producelineselectdlg
      :dialogVisible="this.dialogProduceLineVisible"
      :scheduleMethod="this.scheduleMethod"
      @hideDlg="hideProduceLineDlg"
      @refreshTbl="this.fetchData"
    ></producelineselectdlg>

    <el-dialog
      :title="textMap[dialogStatus]"
      :visible.sync="this.dialogCRUDVisible"
    >
      <el-form
        ref="dataForm"
        :rules="rules"
        :model="temp"
        label-position="left"
        label-width="120px"
        style="width: 400px; margin-left: 50px"
        width="600px"
      >
        <el-form-item label="订单编号" prop="orderNo">
          <el-input v-model="temp.orderNo" />
        </el-form-item>
        <el-form-item label="产品编号" prop="productNo">
          <el-input v-model="temp.productNo" />
        </el-form-item>
        <el-form-item label="产品名称" prop="productName">
          <el-input v-model="temp.productName" />
        </el-form-item>
        <el-form-item label="工序编号" prop="produceLineNo">
          <el-input v-model="temp.produceLineNo" />
        </el-form-item>
        <el-form-item label="工序名称" prop="produceLineName">
          <el-input v-model="temp.produceLineName" />
        </el-form-item>
        <el-form-item label="批次" prop="batch">
          <el-input v-model="temp.batch" />
        </el-form-item>
        <el-form-item label="客户需求量" prop="totalAmount">
          <el-input v-model="temp.totalAmount" />
        </el-form-item>
        <el-form-item label="已生产数量" prop="producedAmount">
          <el-input v-model="temp.producedAmount" />
        </el-form-item>
        <el-form-item label="未生产数量" prop="planAmount">
          <el-input v-model="temp.planAmount" />
        </el-form-item>
        <el-form-item label="交货时间" prop="deliveryDate">
          <el-input v-model="temp.deliveryDate" />
        </el-form-item>
        <el-form-item label="计划开始时间" prop="planProduceStartDate">
          <el-input v-model="temp.planProduceStartDate" />
        </el-form-item>
        <el-form-item label="计划结束时间" prop="planProduceEndDate">
          <el-input v-model="temp.planProduceEndDate" />
        </el-form-item>
        <el-form-item label="工期" prop="duration">
          <el-input v-model="temp.duration" />
        </el-form-item>
        <el-form-item label="最晚生产开始时间" prop="latestProduceStartDate">
          <el-input v-model="temp.latestProduceStartDate" />
        </el-form-item>
        <el-form-item label="最晚生产结束时间" prop="latestProduceEndDate">
          <el-input v-model="temp.latestProduceEndDate" />
        </el-form-item>
        <el-form-item label="排产状态" prop="scheduleState">
          <el-input v-model="temp.scheduleState" />
        </el-form-item>
        <el-form-item label="自由时差" prop="freeFloat">
          <el-input v-model="temp.freeFloat" />
        </el-form-item>
        <el-form-item label="优先级" prop="priority">
          <el-input v-model="temp.priority" />
        </el-form-item>
        <el-row type="flex" justify="start">
          <el-col :span="24">
            <el-table
              v-loading="listLoading"
              :data="listSon"
              element-loading-text="Loading"
              border
              fit
              highlight-current-row
              class="tb-edit"
              @selection-change="handleSelectionChangeSon"
            >
              <el-table-column align="center" label="批次" width="95">
                <template scope="scope">
                  <el-input
                    size="small"
                    v-model="scope.row.batach"
                    placeholder="请输入内容"
                    @change="handleEdit(scope.$index, scope.row)"
                  ></el-input>
                  <span>{{ scope.row.batach }}</span>
                </template>
              </el-table-column>
              <el-table-column align="center" label="批次交货量" width="95">
                <template scope="scope">
                  <el-input
                    size="small"
                    v-model="scope.row.qty"
                    placeholder="请输入内容"
                    @change="handleEdit(scope.$index, scope.row)"
                  ></el-input>
                  <span>{{ scope.row.qty }}</span>
                </template>
              </el-table-column>
              <el-table-column
                align="center"
                label="批次交货时间"
                width="95"
                style="display:none;"
              >
                <template slot-scope="scope">
                  <el-input
                    size="small"
                    v-model="scope.row.deliveryDate"
                    placeholder="请输入内容"
                    @change="ui_update(scope.$index, scope.row)"
                  ></el-input>
                  <span>{{ scope.row.deliveryDate }}</span>
                </template>
              </el-table-column>
              <el-table-column label="操作" width="100">
                <template slot-scope="scope">
                  <span
                    class="el-tag el-tag--info el-tag--mini"
                    style="cursor: pointer;"
                    @click="ui_updateSon(scope.row, scope.$index, true)"
                  >
                    {{ scope.row.isSet ? "保存" : "修改" }}
                  </span>
                  <span
                    v-if="!scope.row.isSet"
                    class="el-tag el-tag--danger el-tag--mini"
                    style="cursor: pointer;"
                    @click="ui_deleteSon(scope.row, scope.$index)"
                  >
                    删除
                  </span>
                  <span
                    v-else
                    class="el-tag  el-tag--mini"
                    style="cursor: pointer;"
                    @click="ui_updateSon(scope.row, scope.$index, false)"
                  >
                    取消
                  </span>
                </template>
              </el-table-column>
            </el-table>
          </el-col>
          <el-col :span="24">
            <div
              class="el-table-add-row"
              style="width: 99.2%;"
              @click="addRow()"
            >
              <span>+ 添加</span>
            </div>
          </el-col>
        </el-row>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button @click="dialogCRUDVisible = false"> 取消 </el-button>
        <el-button
          type="primary"
          @click="dialogStatus === 'create' ? ui_create() : ui_update()"
        >
          确定
        </el-button>
      </div>
    </el-dialog>
  </div>
</template>

<script>
import Pagination from "@/components/Pagination"; // secondary package based on el-pagination
import {
  getAll,
  getList,
  create,
  update,
  deleteBatch
} from "@/api/produce/schedulePlan/ProduceOrderProductPlanApi";
import moment from "moment";
import orderselectdlg from "@/views/produce/schedulePlan/month/orderSelectDlg.vue";
import producelineselectdlg from "@/views/produce/schedulePlan/month/produceLineSelectDlg.vue";

export default {
  name: "schedulemonthson",
  components: { Pagination, orderselectdlg, producelineselectdlg },
  filters: {
    statusFilter(status) {
      const statusMap = {
        UNSCHEDULE: "未排产",
        FORWARD_SCHEDULED: "正排完成",
        FORMARD_EXCEEDED: "正排超时",
        BACKWARD_SCHEDULED: "倒排完成",
        BACKMARD_EXCEEDED: "倒排超时"
      };
      return statusMap[status];
    }
  },
  data() {
    return {
      data2: [],
      list: [],
      listLoading: true,
      total: 0,
      listQuery: {
        page: 1,
        limit: 6,
        pageSizes: [6, 10, 14]
      },
      currentSaleOrderMstTypeId: 0,
      dialogFormVisible: false,
      dialogStatus: "",
      textMap: {
        update: "编辑",
        create: "创建"
      },
      rules: {
        orderNo: [
          {
            required: true,
            message: "订单编号不能为空！",
            trigger: "change"
          }
        ],
        productNo: [
          {
            required: true,
            message: "产品编号不能为空！",
            trigger: "change"
          }
        ],
        productName: [
          {
            required: true,
            message: "产品名称不能为空！",
            trigger: "change"
          }
        ],
        produceProcedureNo: [
          {
            required: true,
            message: "工序编号不能为空！",
            trigger: "change"
          }
        ],
        produceProcedureName: [
          {
            required: true,
            message: "工序名称不能为空！",
            trigger: "change"
          }
        ],
        batch: [
          {
            required: false,
            message: "批次不能为空！",
            trigger: "change"
          }
        ],
        totalAmount: [
          {
            required: true,
            message: "客户需求量不能为空！",
            trigger: "change"
          }
        ],
        producedAmount: [
          {
            required: true,
            message: "已生产数量不能为空！",
            trigger: "change"
          }
        ],
        planAmount: [
          {
            required: true,
            message: "未生产数量不能为空！",
            trigger: "change"
          }
        ],
        deliveryDate: [
          {
            required: true,
            message: "交货时间不能为空！",
            trigger: "change"
          }
        ],
        planProduceStartDate: [
          {
            required: false,
            message: "计划开始时间不能为空！",
            trigger: "change"
          }
        ],
        planProduceEndDate: [
          {
            required: false,
            message: "计划结束时间不能为空！",
            trigger: "change"
          }
        ],
        duration: [
          {
            required: false,
            message: "工期不能为空！",
            trigger: "change"
          }
        ],
        latestProduceStartDate: [
          {
            required: false,
            message: "最晚交货开始时间不能为空不能为空！",
            trigger: "change"
          }
        ],
        latestProduceEndDate: [
          {
            required: false,
            message: "最晚交货结束时间不能为空不能为空！",
            trigger: "change"
          }
        ],
        scheduleState: [
          {
            required: true,
            message: "排产状态不能为空！",
            trigger: "change"
          }
        ],
        freeFloat: [
          {
            required: true,
            message: "自由时差不能为空！",
            trigger: "change"
          }
        ]
      },
      temp: {
        id: undefined,
        orderNo: "",
        productNo: "",
        productName: "",
        produceProcedureNo: "",
        produceProcedureName: "",
        batch: "",
        totalAmount: "",
        producedAmount: "",
        planAmount: "",
        deliveryDate: "",
        planProduceStartDate: "",
        planProduceEndDate: "",
        duration: "",
        latestProduceStartDate: "",
        latestProduceEndDate: "",
        scheduleState: "",
        freeFloat: "",
        priority: 0
      },
      //表格變量
      lstSelected: [],
      queryConditions: {
        orderNo: "",
        productNo: "",
        procedureNo: "",
        updateStartTime: moment(new Date(1900, 5, 27, 15, 44, 11)).format(
          "YYYY-MM-DD HH:mm:ss"
        ),
        updateEndTime: moment(new Date()).format("YYYY-MM-DD HH:mm:ss"),
        scheduleDate: moment(new Date()).format("YYYY-MM-DD HH:mm:ss")
      },
      lstOrders: [],
      dialogProduceLineVisible: false,
      scheduleMethod: 0, //1:正序排产，2:倒序排产
      dialogCRUDVisible: false,

      /**可编辑表格 */
      listSon: [],
      lstSelectedSon: [],
      tempSon: {
        id: 0, //计划Id
        batch: 0, //批次
        qty: 0, //批次数量
        deliveryDate: "", //交货时间
        isSet: false //是否已经设置完
      },
      rowIndex: 0, //行的标识
      selectedDatetimeRange:[],
    };
  },
  mounted() {
    // bus.$on("refreshTbl", () => {
    //   this.fetchData();
    // });
  },
  watch: {},
  computed: {},
  created() {
    this.fetchData();
    this.getAllOrders();
  },
  methods: {
    handleSelectionChange(val) {
      this.lstSelected = val;
      const type = this.list.find(v => v.therbligsNo === val.therbligsNo);
      if (type != null) {
        this.currentSaleOrderMstTypeId = type.id;
      }
    },
    fetchData() {
      let params = {
        page: this.listQuery.page,
        size: this.listQuery.limit
      };
      params = Object.assign(params, this.queryConditions);
      return getList(params).then(response => {
        this.list = response.data.records;
        console.log(this.list);
        this.total = response.data.total;
        this.listLoading = false;
      });
    },
    rowClick(row, column, event) {
      this.currentSaleOrderMstTypeId = row.id;
      this.fetchData();
    },
    resetTemp() {
      this.temp = {
        id: undefined,
        orderNo: "",
        productNo: "",
        productName: "",
        produceProcedureNo: "",
        produceProcedureName: "",
        batch: "",
        totalAmount: "",
        producedAmount: "",
        planAmount: "",
        deliveryDate: "",
        planProduceStartDate: "",
        planProduceEndDate: "",
        duration: "",
        latestProduceStartDate: "",
        latestProduceEndDate: "",
        scheduleState: "",
        freeFloat: "",
        priority: 0
      };
    },
    handleCreate() {
      this.resetTemp();
      this.dialogStatus = "create";
      this.dialogCRUDVisible = true;
      this.$nextTick(() => {
        this.$refs["dataForm"].clearValidate();
      });
    },
    handleUpdate() {
      if (this.lstSelected == null || this.lstSelected.length !== 1) {
        this.$message.error("请先选择一条订单");
        return;
      }
      this.temp = Object.assign({}, this.lstSelected[0]); // copy obj
      // debugger;
      this.temp = { ...this.temp };
      this.dialogStatus = "update";
      this.dialogCRUDVisible = true;
      this.$nextTick(() => {
        this.$refs["dataForm"].clearValidate();
      });
    },
    ui_create() {
      this.$refs["dataForm"].validate(valid => {
        if (valid) {
          this.temp.id = 0; //自增
          create(this.temp).then(() => {
            this.list.unshift(this.temp);
            this.dialogCRUDVisible = false;
            this.$notify({
              title: "Success",
              message: "添加成功！",
              type: "success",
              duration: 2000
            });
          });
        }
      });
    },
    ui_update() {
      this.$refs["dataForm"].validate(valid => {
        if (valid) {
          update(this.temp).then(() => {
            const index = this.list.findIndex(v => v.id === this.temp.id);
            this.list.splice(index, 1, this.temp);
            this.dialogCRUDVisible = false;
            this.$notify({
              title: "Success",
              message: "修改成功！",
              type: "success",
              duration: 2000
            });
          });
        }
      });
    },
    ui_delete(row, index) {
      if (this.lstSelected == null || this.lstSelected.length === 0) {
        this.$message.error("请先选择要删除的ActionTherbligs");
        return;
      }
      let ids = [];
      this.lstSelected.map(function(elm) {
        ids.push(elm.id);
      });
      deleteBatch(ids).then(() => {
        ids.forEach(elm => {
          const index = this.list.findIndex(v => v.id === elm);
          this.list.splice(index, 1);
        });
        this.dialogFormVisible = false;
        this.$notify({
          title: "Success",
          message: "删除成功！",
          type: "success",
          duration: 2000
        });
      });
    },
    handleMainTypeChange(val) {
      this.temp.saleOrderMstTypeId = val;
      this.temp = { ...this.temp };
    },
    handleDateSelectChange(val) {
      this.queryConditions.updateStartTime = moment(val[0]).format(
        "YYYY-MM-DD HH:mm:ss"
      );
      this.queryConditions.updateEndTime = moment(val[1]).format(
        "YYYY-MM-DD HH:mm:ss"
      );
    },
    querySearch(queryString, cb) {
      let orders = this.lstOrders;
      let results = queryString
        ? this.lstOrders.filter(this.createFilter(queryString))
        : this.lstOrders;
      // 调用 callback 返回建议列表的数据
      cb(results);
    },
    createFilter(queryString) {
      return p => {
        return p.value.toLowerCase().indexOf(queryString.toLowerCase()) === 0;
      };
    },
    handleSelect(val) {
      this.queryConditions.orderNo = val.value;
    },
    handleInput(val) {
      this.queryConditions.orderNo = val;
    },
    getAllOrders() {
      getAll().then(response => {
        let result = response.data;
        if (result != null && result.length > 0) {
          result.map(v => {
            this.lstOrders.push({ value: v.orderno });
          });
        }
      });
    },
    goDayReport() {
      this.$router.push("/orderManager/scheduleMonth/materialRequiredList");
    },
    /*
     *添加订单
     */

    addOrder() {
      this.dialogFormVisible = true;
    },
    /**
     * 子组件关闭时通知父组件
     */
    hideDlg(e) {
      this.dialogFormVisible = e;
    },
    /**
     * 子组件关闭时通知父组件
     */
    hideProduceLineDlg(e) {
      this.dialogProduceLineVisible = e;
      this.scheduleMethod = 0;
    },
    sechedule() {
      this.scheduleMethod = 1;
      this.dialogProduceLineVisible = true;
    },
    secheduleReverse() {
      this.scheduleMethod = 2;
      this.dialogProduceLineVisible = true;
    },
    deletePlan() {
      if (this.lstSelected == null || this.lstSelected.length === 0) {
        this.$message.error("请先选择要删除的排产记录");
        return;
      }
      let ids = [];
      this.lstSelected.map(function(elm) {
        ids.push(elm.id);
      });
      deleteBatch(ids).then(() => {
        this.fetchData();
        this.$notify({
          title: "Success",
          message: "删除成功！",
          type: "success",
          duration: 2000
        });
      });
    },
    /**可编辑表格 */
    addRow() {
      this.resetTempSon();
      this.tempSon.id = this.rowIndex++;
      this.listSon.push(this.tempSon);
    },
    handleSelectionChangeSon(val) {
      this.lstSelectedSon = val;
    },
    resetTempSon() {
      this.tempSon = {
        id: 0, //计划Id
        batch: 0, //批次
        qty: 0, //批次数量
        deliveryDate: "" //交货时间
      };
    },
    ui_deleteSon(row, index) {
      debugger;
      let idx = this.listSon.findIndex(v => v.id == row.id);
      if (idx != null && idx >= 0) this.listSon.splice(idx);
    }
  }
};
</script>
<style scoped>
.item1 {
  margin-top: 20px;
}
.wapperSon {
  display: flex;
  justify-content: space-around;
  align-items: center;
}
.app-container {
  padding: 0;
}

/**edit table css */
.tb-edit .el-input {
  display: none;
}
.tb-edit .current-row .el-input {
  display: block;
}
.tb-edit .current-row .el-input + span {
  display: none;
}
.el-table-add-row {
  margin-top: 10px;
  width: 100%;
  height: 34px;
  border: 1px dashed #c1c1cd;
  border-radius: 3px;
  cursor: pointer;
  justify-content: center;
  display: flex;
  line-height: 34px;
}
</style>
